-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MultiDB]: install default db config file when installing libswsscommon if there is no such a file #321
Conversation
…lib if there is no one
@qiluo-msft installing default db config file if there is no one in expected location. |
Thanks for implement the logic manually. I guess http://man7.org/linux/man-pages/man5/deb-conffiles.5.html is just for that, could you help explorer? Refers to: debian/postinst:12 in ef01c58. [](commit_id = ef01c58, deletion_comment = False) |
Hi Qi, conffiles works, but there is one concern. When we use conffiles, if the config file already exists, installing deb pkg will give a prompt as below. The user needs to decide what to do next.
|
Thanks @dzhangalibaba ! Could you please share your code about "conffiles works" in another PR? I would like to explorer further. To suppress dpkg prompt is the right thing to do in future. |
FYI, #323 |
DST_FILE="database_config.json" | ||
SRC_PATH="/usr/share/swss" | ||
|
||
# if there is no $DST_FILE, it is needed to copy one default to $DST_FILE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if file exists we should copy this one one wih suffix ".new" to the same directory to indicate that there is new configuration, btw. i though that there is mechanism already in debian packages to do that, instead manually do that for each file, here is some nice explanation: https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can add suffix to save this conf, but we won’t use confines as explained under Qi’s comment, we don’t want prompt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Just as a question, our future goal is to support multiple syncd's running across system, controlled by single OA agent, some requirements i posted in my long email:
my question here is whether we want this information in this file or do we need other file? this switch/syncd info is something more than db config, but it strictly depends on database configuration which is defined in this file note: different syncd instances can ha same database server used, but asic_db index must be different for each syncd instance |
I think we need extend current conf file to support the case you mention. And then add the backend logic to parse conf file to finish the work what you case want |
seems good to me |
Signed-off-by: Dong Zhang d.zhang@alibaba-inc.com